<!-- Right side column. Contains the navbar and content of the page -->
<aside class="right-side">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            <?php echo $this->lang->line('menu_member'); ?>
            <small><?php echo $this->lang->line('webname'); ?></small>
        </h1>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <!-- left column -->
            <div class="col-xs-12">
                <!-- general form elements -->
                <div class="box box-danger">
                    <div class="box-header">
                        <h3 class="box-title">
                            <?php if ($member_id) { ?>
                                <?php echo $this->lang->line('update'); ?>
                            <?php } else { ?>
                                <?php echo $this->lang->line('tambah'); ?>
                            <?php } ?>
                        </h3>
                    </div><!-- /.box-header -->
                    <!-- form start -->
                    <?php if ($member_id) { ?>
                        <?php echo form_open('members/edit/id/' . $member_id); ?>
                    <?php } else { ?>
                        <?php echo form_open('members/add'); ?>
                    <?php } ?>
                    <div class="box-body">
                        <?php if (!is_null($message)) echo $message; ?>
                        <?php echo validation_errors(); ?>

                        <div class="form-group">
                            <label><?php echo $this->lang->line('nama'); ?></label>
                            <input class="form-control" type="text" name="in_m_nama" value="<?php echo set_value('in_m_nama', (isset($members->member_nama)) ? $members->member_nama : ''); ?>" size="30" <?php if ($member_id) { ?>readonly="true" <?php } ?> />
                        </div>

                        <?php if ($this->auth->cek_role_member() == '1') { ?>
                            <div class="form-group">
                                <label><?php echo $this->lang->line('pass'); ?></label>
                                <input class="form-control" type="password" name="in_m_pass" value="<?php echo set_value('in_m_pass', (isset($members->member_pass)) ? $members->member_pass : ''); ?>" />
                            </div>

                            <div class="form-group">
                                <label><?php echo $this->lang->line('pass2'); ?></label>
                                <input class="form-control" type="password" name="in_m_pass2" value="<?php echo set_value('in_m_pass2', (isset($members->member_pass)) ? $members->member_pass : ''); ?>" />
                            </div>
                        <?php } ?>

                        <div class="form-group">
                            <label><?php echo $this->lang->line('namanya'); ?></label>
                            <input class="form-control" type="text" name="in_m_namanya" value="<?php echo set_value('in_m_namanya', (isset($members->member_namanya)) ? $members->member_namanya : ''); ?>" />
                        </div>

                        <div class="form-group">
                            <label><?php echo $this->lang->line('kelamin'); ?></label>
                            <select name="in_m_kelamin" class="form-control">
                                <?php foreach ($members_kelamin AS $val => $member_kelamin) { ?>
                                    <option <?php if (set_value('in_kelamin', (isset($members->member_kelamin)) ? $members->member_kelamin : '') == $val) { ?>selected<?php } ?> value="<?php echo $val; ?>"><?php echo $member_kelamin; ?></option>
                                <?php } ?>
                            </select>
                        </div>

                        <div class="form-group">
                            <label><?php echo $this->lang->line('email'); ?></label>
                            <input class="form-control" type="text" name="in_m_email" value="<?php echo set_value('in_m_email', (isset($members->member_email)) ? $members->member_email : ''); ?>">
                        </div>

                        <div class="form-group">
                            <label><?php echo $this->lang->line('role'); ?></label>
                            <select name="in_m_role" class="form-control">
                                <?php foreach ($members_role AS $val => $member_role) { ?>
                                    <option <?php if (set_value('in_m_role', (isset($members->member_role)) ? $members->member_role : '') == $val) { ?>selected<?php } ?> value="<?php echo $val; ?>"><?php echo $member_role; ?></option>
                                <?php } ?>
                            </select>
                        </div>

                        <div class="form-group">
                            <label><?php echo $this->lang->line('aktifasi'); ?></label>
                            <select name="in_m_aktifasi" class="form-control">
                                <?php foreach ($aktifs AS $val => $aktif) { ?>
                                    <option <?php if (set_value('in_m_aktifasi', (isset($members->member_aktifasi)) ? $members->member_aktifasi : '') == $val) { ?>selected<?php } ?> value="<?php echo $val; ?>"><?php echo $aktif; ?></option>
                                <?php } ?>
                            </select>
                        </div>

                        <div class="form-group">
                            <label><?php echo $this->lang->line('status'); ?></label>
                            <select name="in_m_status" class="form-control">
                                <?php foreach ($aktifs AS $val => $aktif) { ?>
                                    <option <?php if (set_value('in_m_status', (isset($members->member_status)) ? $members->member_status : '') == $val) { ?>selected<?php } ?> value="<?php echo $val; ?>"><?php echo $aktif; ?></option>
                                <?php } ?>
                            </select>
                        </div>
                    </div><!-- /.box-body -->

                    <div class="box-footer">
                        <?php if ($member_id) { ?>
                            <input class="btn btn-primary" type="submit" name="btn_update" value="<?php echo $this->lang->line('update'); ?>" />
                        <?php } else { ?>
                            <input class="btn btn-primary" type="submit" name="btn_tambah" value="<?php echo $this->lang->line('tambah'); ?>" />
                        <?php } ?>
                        <?php echo anchor('members/', $this->lang->line('batal'), array('class' => 'btn btn-success')); ?>
                    </div>
                    </form>
                </div><!-- /.box -->
            </div><!--/.col (right) -->
        </div>   <!-- /.row -->
    </section><!-- /.content -->
</aside><!-- /.right-side -->

